/*

Stickman Adventure - a game created by Daco & his cousin

Copyright (C) 2011-2012  DacoTaco & Wouterke

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation version 2.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


*/
#ifndef _GLOBAL_H
#define _GLOBAL_H

#include "SDL.h" 
#ifdef OGL_MODE
#include "SDL_opengl.h"
#endif
#include "SDL_image.h"
#include "SDL_rotozoom.h"
#include <string>
#include <SDL_mixer.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#ifdef DEBUG
	#define gprintf printf
#else
	#define gprintf(...)
#endif


extern bool _log;

#define FRAMES_PER_SECOND 32
#define INVALID (TYPE_LIST_SIZE +1)

// dont forget 2 change compare map in Object_collection if you change order or add types
enum {
	OBJECT_BACKGROUND,
	OBJECT_PLATFORM,
	OBJECT_ENEMY,
	OBJECT_PLAYER,
	OBJECT_SCREEN,
	TYPE_LIST_SIZE,
};



SDL_Surface* SPG_CopySurface(SDL_Surface* src);
SDL_Surface *load_image( std::string filename, unsigned int color_key );
#ifdef OGL_MODE
void apply_surface( int x, int y, int h,int w, GLuint *texture, SDL_Rect* clip);
#endif
void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip);
void apply_surface( SDL_Rect* colrect, SDL_Surface* destination,int colour);




#endif